﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class src_Login2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void BLogin_Click(object sender, EventArgs e)
    {
         String username  = TBUsername.Text.ToString();
        String password  = TBPassword.Text.ToString();




        if (TBUsername.Text != "" && TBPassword.Text != "")
        {
            List<String> ris = DB.selectQuery("DBForum", "select nomeutente from utente where nomeutente ='" + username + "' and pass ='" + password + "'");
        if (ris[0] != "0")
        {
            utenteCore user = new utenteCore();

            user.username = username;

            //user.login();

            Session["user"] = user;

            LLog.Text = "Benvenuto " + user.username;

        }
        else 
            
            LLog.Text = "Nome utente e password sbagliati";
        }

    }
  }
